#ifndef _GET_INPUT_FILE_
#define _GET_INPUT_FILE_

//#include "file_manage.h"
#include "time_count.h"
#include <boost/filesystem.hpp>
#include <fstream>
#include <iostream>
#include <string>
#include <vector>
//#include "basis_state.h"

using std::cerr;
using std::cout;
using std::endl;
using std::string;
using std::vector;

struct Info_SP {
  string Type; // E_max or Read
  int SP_Num;
  int E_max;
  vector<vector<int>> sp_vec;
};

struct Info_TP {
  string Type; // E_max or Read
  int E_max = -1;
  vector<int> abc_vec;
};

struct Info_TP_allow {
  int E_cut;
  int Same_particle_Flag;
  vector<vector<int>> tp_al_vec;
};

struct Info_Wave_Para {
  int Lambda_Cut;
  double hbar_omega;
  int regulator_power;
  int k_mesh;
  int k_scale;
  int p_mesh;
  int EF_max;
  int EI_max;
  int n_max;
  int l_max;
  int lbarS;
  int lbarS_G;
  int lbarS_P;
};

struct Info_Coeff_Para {
  int J_max_cg;
  int J_max_sixJ;
  int n_max_bino;
};

struct Info_Trans_Test {
  int Trans_Test_Flag;
  string trans_file_std; // correct trans_file
};

class Get_Info {
public:
  Get_Info(){};
  string Input_File;
  Info_SP sp_info;
  Info_TP tp_info;
  vector<Info_TP_allow> tp_al_info;
  Info_Wave_Para wave_info;
  Info_Coeff_Para coeff_para;
  Info_Trans_Test trans_test;
  int output_flag = 1; // if < 0 don't output

  void init(string filename) { this->Input_File = filename; }
  void build() {
    this->get_SP();
    this->get_TP();
    this->get_TP_allow();
    this->get_Wave_Info();
    this->get_Coeff_Para();
    this->get_Trans_Test();
  }
  void build(int output_flag_t) {
    this->output_flag = output_flag_t;
    this->get_SP();
    this->get_TP();
    this->get_TP_allow();
    this->get_Wave_Info();
    this->get_Trans_Test();
  }
  void get_SP();
  void get_TP();
  void get_TP_allow();
  void get_Wave_Info();
  void get_Coeff_Para();
  void get_Trans_Test();
  void print(std::string filename);
};

struct TBME_Info {
  string filename_int;
  string filename_orb;
};

struct Info_DP_allow {
  int E_cut;
  int Same_particle_Flag;
  vector<vector<int>> dp_al_vec;
};

struct Info_DP {
  // string Type; // E_max or Read
  // int E_max;

  vector<int> ab_vec;
};

struct Info_Model_Space {
  int E_cut;
  int sp_core;
  int sp_core_Tz;
  int sp_P_beg;
  int sp_P_beg_Tz;
  int sp_P_end;
  int sp_P_end_Tz;
  int sp_Q_beg;
  int sp_Q_beg_Tz;
  int sp_Q_end;
  int sp_Q_end_Tz;
};

class Get_Info_MB {
public:
  Get_Info_MB(){};
  string Input_File;
  TBME_Info tbme_info;
  Info_DP dp_info;
  Info_Model_Space ms_info;
  vector<Info_DP_allow> dp_al_info;
  int output_flag = 1; // if < 0 don't output
  void init(string filename) { this->Input_File = filename; }
  void get_TBME_info();
  void get_DP_info();
  void get_DP_allow_info();
  void get_Model_Space_info();
  void build() {
    this->get_TBME_info();
    this->get_Model_Space_info();
    this->get_DP_info();
    this->get_DP_allow_info();
  }
};

#endif
